import DefaultPage      from "@/views/DefaultPage/DefaultPage.vue";
import SingFilePage     from "@/views/SingFilePage/SingFilePage.vue";
import FileModePage     from "@/views/FileModePage/FileModePage.vue";
import ErrorPage        from "@/views/ErrorPage/ErrorPage.vue";
import StylePage        from "@/views/StylePage/StylePage.vue";
import BuildPage        from "@/views/BuildPage/BuildPage.vue";

import AjaxPage         from "@/views/AjaxPage/AjaxPage.vue";
import BaseUseAxios     from "@/views/AjaxPage/components/BaseUseAxios.vue";
import ModuleUseAxios   from "@/views/AjaxPage/components/ModuleUseAxios.vue";
import UtilUseAxios     from "@/views/AjaxPage/components/UtilUseAxios.vue";
import AjaxUseProxy     from "@/views/AjaxPage/components/AjaxUseProxy.vue";

import RoutePage        from "@/views/RoutePage/RoutePage.vue";
import RouterLinkView   from "@/views/RoutePage/components/RouterLinkView.vue";

import ElementUIPage    from "@/views/ElementUIPage/ElementUIPage.vue";
import NotFound         from "@/views/NotFound/NotFound.vue";


export default [
    // {
    //     path:"/",
    //     component:DefaultPage
    // },
    {
        path:"/",
        redirect:"/default",
    },
    {
        // 定义路由页面组件的地址
        path: "/default",
        // 定义路由页面对应的vue组件
        component: DefaultPage
    },
    {
        path: "/sing",
        component: SingFilePage
    },
    {
        path: "/file",
        component: FileModePage
    },
    {
        path: "/error",
        component: ErrorPage
    },
    {
        path: "/style",
        component: StylePage
    },
    {
        path: "/build",
        component: BuildPage
    },
    {
        path: "/ajax",
        component: AjaxPage,
        // 在当前主路由下定义子路由组件
        children:[
            {
                path:"",
                redirect:"/base"
                // redirect:"/ajax/util"
            },
            {
                path:"/base",
                component:BaseUseAxios
            },
            {
                path:"/test/module",
                component:ModuleUseAxios
            },
            {
                path:"util",
                component:UtilUseAxios
            },
            {
                path:"test/proxy",
                component:AjaxUseProxy
            },
            {
                path:":errorPath(.*)*",
                component:NotFound
            }
        ]
    },
    {
        path: "/route",
        component: RoutePage,
        children:[
            {
                path:"link",
                component:RouterLinkView
            },
            {
                path:":errorPath(.*)*",
                component:NotFound
            }
        ]
    },
    {
        path: "/element",
        component: ElementUIPage
    },
    // {
    //     path:"/:errorPath(.*)*",
    //     redirect:"/default"
    // }
    {
        path:"/:errorPath(.*)*",
        component:NotFound
    },
]